## Loading required package: assertthat
## Warning: package 'assertthat' was built under R version 4.0.3
## 
## Attaching package: 'assertthat'
## The following object is masked from 'package:tibble':
## 
##     has_name
## Loading required package: glue
## Warning: package 'glue' was built under R version 4.0.3
## 
## Attaching package: 'glue'
## The following object is masked from 'package:dplyr':
## 
##     collapse
## Loading required package: rlang
## Warning: package 'rlang' was built under R version 4.0.3
## 
## Attaching package: 'rlang'
## The following object is masked from 'package:assertthat':
## 
##     has_name
## The following objects are masked from 'package:purrr':
## 
##     %@%, as_function, flatten, flatten_chr, flatten_dbl, flatten_int,
##     flatten_lgl, flatten_raw, invoke, list_along, modify, prepend,
##     splice
## `summarise()` has grouped output by 'ifbl_4by4', 'Jaar', 'TaxonIDParent'. You can override using the `.groups` argument.
## 
## -- Column specification --------------------------------------------------------
## cols(
##   id = col_double(),
##   code = col_character(),
##   naam_nederlands = col_character(),
##   naam_wetenschappelijk = col_character(),
##   taxn_vrs_key = col_character(),
##   taxongroep = col_character(),
##   usageKey = col_double(),
##   scientificName = col_character(),
##   rank = col_character(),
##   order = col_character(),
##   matchType = col_character(),
##   phylum = col_character(),
##   kingdom = col_character(),
##   genus = col_character(),
##   class = col_character(),
##   confidence = col_double(),
##   synonym = col_logical(),
##   status = col_character(),
##   family = col_character()
## )
## i Using ',' as decimal and '.' as grouping mark. Use `read_delim()` for more control.
## 
## -- Column specification --------------------------------------------------------
## cols(
##   substraat = col_character(),
##   substrate = col_character()
## )

1 Exploratory data analysis

phylum n_obs n_soorten n_hokken
Anthocerotophyta 218 4 123
Bryophyta 95624 410 796
Marchantiophyta 17486 109 727

## `summarise()` has grouped output by 'phylum'. You can override using the `.groups` argument.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## Joining, by = "substraat"
phylum substrate number of species
Bryophyta artificial stone 84
Bryophyta bryophyte 3
Bryophyta decaying vegetation 21
Bryophyta decorticated wood 48
Bryophyta epiphytic on living wood 73
Bryophyta floating on water 1
Bryophyta gravel or sand 108
Bryophyta mineral soil 211
Bryophyta peat 47
Bryophyta rock, hard 95
Bryophyta rock, soft 38
Bryophyta soil on rock 68
Marchantiophyta artificial stone 9
Marchantiophyta bryophyte 17
Marchantiophyta decaying vegetation 18
Marchantiophyta decorticated wood 16
Marchantiophyta epiphytic on living wood 15
Marchantiophyta floating on water 3
Marchantiophyta gravel or sand 34
Marchantiophyta mineral soil 67
Marchantiophyta peat 30
Marchantiophyta rock, hard 14
Marchantiophyta rock, soft 14
Marchantiophyta soil on rock 20
phylum ell_l number of species
Bryophyta 1 9
Bryophyta 2 19
Bryophyta 3 37
Bryophyta 4 86
Bryophyta 5 125
Bryophyta 6 188
Bryophyta 7 189
Bryophyta 8 129
Bryophyta 9 15
Marchantiophyta 1 1
Marchantiophyta 3 20
Marchantiophyta 4 51
Marchantiophyta 5 51
Marchantiophyta 6 60
Marchantiophyta 7 56
Marchantiophyta 8 18
phylum ell_r number of species
Bryophyta 1 10
Bryophyta 2 63
Bryophyta 3 88
Bryophyta 4 67
Bryophyta 5 95
Bryophyta 6 141
Bryophyta 7 215
Bryophyta 8 101
Bryophyta 9 17
Marchantiophyta 1 28
Marchantiophyta 2 60
Marchantiophyta 3 20
Marchantiophyta 4 52
Marchantiophyta 5 30
Marchantiophyta 6 38
Marchantiophyta 7 21
Marchantiophyta 8 6
Marchantiophyta 9 2
phylum ell_f number of species
Bryophyta 1 12
Bryophyta 2 12
Bryophyta 3 61
Bryophyta 4 152
Bryophyta 5 187
Bryophyta 6 176
Bryophyta 7 51
Bryophyta 8 69
Bryophyta 9 54
Bryophyta 10 14
Bryophyta 11 4
Bryophyta 12 5
Marchantiophyta 4 15
Marchantiophyta 5 51
Marchantiophyta 6 52
Marchantiophyta 7 50
Marchantiophyta 8 47
Marchantiophyta 9 32
Marchantiophyta 10 9
Marchantiophyta 11 1
phylum ell_n number of species
Bryophyta 1 32
Bryophyta 2 195
Bryophyta 3 139
Bryophyta 4 196
Bryophyta 5 137
Bryophyta 6 71
Bryophyta 7 27
Marchantiophyta 1 43
Marchantiophyta 2 97
Marchantiophyta 3 45
Marchantiophyta 4 36
Marchantiophyta 5 23
Marchantiophyta 6 8
Marchantiophyta 7 5
phylum ell_t number of species
Bryophyta 2 52
Bryophyta 3 269
Bryophyta 4 142
Bryophyta 5 155
Bryophyta 6 108
Bryophyta 7 58
Bryophyta 8 13
Marchantiophyta 2 27
Marchantiophyta 3 113
Marchantiophyta 4 51
Marchantiophyta 5 43
Marchantiophyta 6 13
Marchantiophyta 7 2
Marchantiophyta 8 8

Only remove substrate levels with less than 5 species (for Ellenberg variables this is not necessary because they are included as continuous covariate).

## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2

phylum substrate n
Bryophyta artificial stone 84
Bryophyta decaying vegetation 21
Bryophyta decorticated wood 48
Bryophyta epiphytic on living wood 73
Bryophyta gravel or sand 108
Bryophyta mineral soil 211
Bryophyta peat 47
Bryophyta rock, hard 95
Bryophyta rock, soft 38
Bryophyta soil on rock 68
Marchantiophyta artificial stone 9
Marchantiophyta bryophyte 17
Marchantiophyta decaying vegetation 18
Marchantiophyta decorticated wood 16
Marchantiophyta epiphytic on living wood 15
Marchantiophyta gravel or sand 34
Marchantiophyta mineral soil 67
Marchantiophyta peat 30
Marchantiophyta rock, hard 14
Marchantiophyta rock, soft 14
Marchantiophyta soil on rock 20
## Warning: Ignoring unknown aesthetics: text
## `geom_smooth()` using formula 'y ~ x'
## Warning: Ignoring unknown aesthetics: text
## Warning in qlogis(prop_2000_2019): NaNs produced

## Warning in qlogis(prop_2000_2019): NaNs produced

## Warning in qlogis(prop_2000_2019): NaNs produced
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 7 rows containing non-finite values (stat_smooth).
## # A tibble: 126 x 2
##    n_hok_1980_1999     n
##              <int> <int>
##  1               0   245
##  2               5    34
##  3               6    18
##  4               7    18
##  5               8    12
##  6               9    22
##  7              10    12
##  8              11    14
##  9              12    11
## 10              13     8
## # ... with 116 more rows
## # A tibble: 142 x 2
##    n_hok_2000_2019     n
##              <int> <int>
##  1               0    18
##  2               1    87
##  3               2    60
##  4               3    35
##  5               4    32
##  6               5    26
##  7               6    27
##  8               7    12
##  9               8    17
## 10               9    25
## # ... with 132 more rows

2 Methods

3 Results

3.1 Model selection

Table 3.1: Results of model comparisons. First row contains the model with the highest predictive accuracy. The best model contained an effect for Ellenberg moisture and a phylum specific effect for Ellenberg temperature in addition to the effects dealing with sampling effort and substrate.
elpd_diff se_diff elpd_loo se_elpd_loo p_loo se_p_loo looic se_looic
alt_telfer_3 0.00 0.00 -3315.90 31.29 21.92 3.20 6631.79 62.59
alt_telfer_2 -1.24 1.23 -3317.14 31.17 23.80 3.55 6634.27 62.34
alt_telfer -3.12 1.43 -3319.02 31.20 25.71 3.52 6638.04 62.40

3.2 Model diagnostics

plot(loo1$loos$alt_telfer_3, label_points = TRUE)

## Using 10 posterior samples for ppc type 'dens_overlay' by default.

3.3 Model summary of best predictive model

## Warning in checkMatrixPackageVersion(): Package version inconsistency detected.
## TMB was built with Matrix version 1.3.2
## Current Matrix version is 1.2.18
## Please re-install 'TMB' from source using install.packages('TMB', type = 'source') or ask CRAN for a binary version of 'TMB' matching CRAN's 'Matrix' package
## Registered S3 method overwritten by 'broom.mixed':
##   method      from 
##   tidy.gamlss broom
## Warning in tidy.brmsfit(alt_telfer_3): some parameter names contain underscores:
## term naming may be unreliable!
effect component group term estimate std.error conf.low conf.high
fixed cond NA (Intercept) 0.4919680 0.1317849 0.2302422 0.7401416
fixed cond NA qlogisn_hok_1980_1999Dn_hok_tot_1980_1999 0.8957029 0.0174347 0.8609518 0.9296215
fixed cond NA phylumMarchantiophyta -0.7304786 0.1771423 -1.0860043 -0.3877966
fixed cond NA ell_f -0.0597816 0.0141425 -0.0867689 -0.0329749
fixed cond NA ell_t 0.0269439 0.0186414 -0.0099345 0.0640885
fixed cond NA qlogisn_hok_1980_1999Dn_hok_tot_1980_1999:phylumMarchantiophyta 0.0337438 0.0395092 -0.0414930 0.1105633
fixed cond NA phylumMarchantiophyta:ell_t 0.0914692 0.0392580 0.0137853 0.1688416
ran_pars cond substrate sd__(Intercept) 0.1627244 0.0538369 0.0861780 0.2946712
ran_pars cond substrate sd__phylumMarchantiophyta 0.1069512 0.0819049 0.0046895 0.3083341

3.4 Model visualisation

## Adding missing grouping variables: `phylum`
## Note: Using an external vector in selections is ambiguous.
## i Use `all_of(ellenberg)` instead of `ellenberg` to silence this message.
## i See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## This message is displayed once per session.
## Adding missing grouping variables: `phylum`
## Adding missing grouping variables: `phylum`
## Adding missing grouping variables: `phylum`

3.4.1 Y-scale = expected number of occurrences (out of 228 grid cells)

Figure 3.1

Change in recording probability. The total number of occupied grid cells in both periods equals 228. Points: observed values. Lines with ribbons: expectations and 95% confidence bounds conditional on ell_f = 5.89 & ell_t = 4.19. Black line: line of no change.

Figure 3.1: Change in recording probability. The total number of occupied grid cells in both periods equals 228. Points: observed values. Lines with ribbons: expectations and 95% confidence bounds conditional on ell_f = 5.89 & ell_t = 4.19. Black line: line of no change.

Figure 3.2

Effect of Ellenberg moisture values on occurrence of mosses. Points: observed values. Line with ribbons: expectation and 95% confidence bounds conditional on n_hok_1980_1999 = 72.3 & ell_t = 4.19. No interaction effect was modeled.

Figure 3.2: Effect of Ellenberg moisture values on occurrence of mosses. Points: observed values. Line with ribbons: expectation and 95% confidence bounds conditional on n_hok_1980_1999 = 72.3 & ell_t = 4.19. No interaction effect was modeled.

Figure 3.3

Effect of Ellenberg temperature values on occurrence of mosses. Points: observed values. Line with ribbons: expectation and 95% confidence bounds conditional on n_hok_1980_1999 = 72.3 & ell_f = 5.89.

Figure 3.3: Effect of Ellenberg temperature values on occurrence of mosses. Points: observed values. Line with ribbons: expectation and 95% confidence bounds conditional on n_hok_1980_1999 = 72.3 & ell_f = 5.89.

Figure 3.4

Effect of substrate on occurrence of mosses. Points and ranges: expectation and 95% confidence interval conditional on n_hok_1980_1999 = 72.3 & ell_f = 5.89 & ell_t = 4.19.

Figure 3.4: Effect of substrate on occurrence of mosses. Points and ranges: expectation and 95% confidence interval conditional on n_hok_1980_1999 = 72.3 & ell_f = 5.89 & ell_t = 4.19.

3.4.2 Y-scale = odds-ratio

3.4.3 Y-scale = linear difference in logit scale

References

Bürkner, Paul-Christian. 2017. “Brms : An R Package for Bayesian Multilevel Models Using Stan.” Journal of Statistical Software 80 (1): 1–28. https://doi.org/10.18637/jss.v080.i01.

Bürkner, Paul-Christian, and Emmanuel Charpentier. 2020. “Modelling Monotonic Effects of Ordinal Predictors in Bayesian Regression Models.” British Journal of Mathematical and Statistical Psychology 73 (3): 420–51. https://doi.org/10.1111/bmsp.12195.

Gelman, Andrew, Jennifer Hill, and Masanao Yajima. 2012. “Why We (Usually) Don’t Have to Worry About Multiple Comparisons.” Journal of Research on Educational Effectiveness 5 (2): 189–211. https://doi.org/10.1080/19345747.2011.618213.

R Core Team. 2020. R: A Language and Environment for Statistical Computing. Manual. Vienna, Austria: R Foundation for Statistical Computing.

Telfer, Mark G, C. D. Preston, and Peter Rothery. 2002. “A General Method for Measuring Relative Change in Range Size from Biological Atlas Data.” Biological Conservation 107 (1): 99–109. https://doi.org/10.1016/S0006-3207(02)00050-2.

Vehtari, Aki, Andrew Gelman, and Jonah Gabry. 2017. “Practical Bayesian Model Evaluation Using Leave-One-Out Cross-Validation and WAIC.” Statistics and Computing 27 (5): 1413–32. https://doi.org/10.1007/s11222-016-9696-4.